win10系统常用命令(netstat、ping、telnet、sc、netsh命令) |
您所在的位置:网站首页 › netsh interface ip show joins › win10系统常用命令(netstat、ping、telnet、sc、netsh命令) |
netstat命令
1. 查找端口占用 netstat -ano netstat -ano | findstr 5000 ping命令ping 192.168.1.1 ping baidu.com telnet命令telnet 192.168.1.1 80 telnet baidu.com 80 sc命令1. 安装服务 sc create [] binPath=[] 2. 配置服务 sc config [] start=auto // 自动 sc config [] start=demand // 手动 sc config [] start=disabled // 禁用 3. 开始服务 sc start [] net start [] // net 命令用于没有被禁用的服务 4. 结束服务 sc end [] net end [] // net 命令用于没有被禁用的服务 5. 删除服务 sc delete [] 6. 查询服务 状态 sc query [] 7. 添加服务描述 sc description [] [] 8. 设置常量和使用 set []=[] 使用:%serviceName% 9. bat 注释 REM REM XXX 10. bat 退出命令 pause set serviceName=AlarmCenterService set serviceFilePath=D:\workspace\AlarmCenterService\Publish\AlarmCenterService.exe set serviceDescription="AlarmCenterService 报警中心服务" REM 创建服务 sc create %serviceName% BinPath=%serviceFilePath% REM 改变服务的启动方式 手动/自动/禁用 REM sc config ServiceName start=demand/auto/disabled sc config %serviceName% start=auto REM 添加服务描述 sc description %serviceName% %serviceDescription% REM 启动服务 sc start %serviceName% pausenetsh命令 1. 查看网络配置 netsh interface ip show { address | config | dns | icmp | interface | ipaddress | ipnet | ipstats | joins | offload | tcpconn | tcpstats | udpconn | udpstats | wins} address - 显示 IP 地址配置。 config - 显示 IP 地址和更多信息。 dns - 显示 DNS 服务器地址。 icmp - 显示 ICMP 统计。 interface - 显示 IP 接口统计。 ipaddress - 显示当前 IP 地址 ipnet - 显示 IP 的网络到媒体的映射。 ipstats - 显示 IP 统计。 joins - 显示加入的多播组。 offload - 显示卸载信息。 tcpconn - 显示 TCP 连接。 tcpstats - 显示 TCP 统计。 udpconn - 显示 UDP 连接。 udpstats - 显示 UDP 统计。 wins - 显示 WINS 服务器地址。 2. 修改本机IP netsh interface ip set address name="本地连接" source=static 192.168.1.188 255.255.255.0 192.168.1.1 1 // 自动获取ip netsh interface ip set address name="本地连接" source=dhcp 3. 添加本机dns netsh interface ip set dns "本地连接" static 18.0.0.10 primary // 自动获取dns netsh interface ip set dns "本地连接" dhcp 4. 添加本机副DNS netsh interface ip add dns "本地连接" 18.0.0.10 5. 导出网络配置文件 netsh -c interface dump >c:\dump.txt // ">"表示导出。">>"表示追加 6. 导入网络配置文件 netsh -f c:\dump.txt netsh exec c:\dump.txt
7. 查看防火墙 netsh firewall show state 8. 禁用防火墙 netsh firewall set opmode disable 9. 启动防火墙 netsh firewall set opmode enable 10. 重置防火墙 netsh firewall reset 11. 添加进站规则 netsh firewall add portopenint 协议 端口 名称 netsh firewall add portopenint tcp 3306 mysql 12. 删除进站规则 netsh firewall delete portopenint tcp 333
13. 创建无线网 netsh wlan set hostednetwork mode=allow ssid=wwl key=12346789 14. 开始无线wifi netsh wlan start hostednetwork 15. 关闭无线wifi netsh wlan stop hostednetwork 16. 查看wifi信息 netsh wlan show hostednetwork 17. 端口映射 // 把本地端口8888 转发到 10.0.0.2的 3389端口上 netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=8888 connectaddress=10.0.0.2 connectport=3389 18. 关闭端口映射 netsh interface portproxy delete v4tov4 listenaddress=127.0.0.1 listenport=8888 19. 查看所有端口映射 netsh interface protproxy show all |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |